package com.bw.medical.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bw.common.utils.PageUtils;
import com.bw.common.utils.Query;

import com.bw.medical.dao.HospitalDao;
import com.bw.medical.entity.HospitalEntity;
import com.bw.medical.service.HospitalService;


@Service("hospitalService")
public class HospitalServiceImpl extends ServiceImpl<HospitalDao, HospitalEntity> implements HospitalService {

    @Override
    public PageUtils queryPage(Map<String, Object> params,String hospitalName) {
        QueryWrapper<HospitalEntity> wrapper = new QueryWrapper<>();
        if (hospitalName!=null&& !hospitalName.equals("")){
            wrapper.like("hospital_name",hospitalName);
        }
        IPage<HospitalEntity> page = this.page(
                new Query<HospitalEntity>().getPage(params),
                wrapper
        );
        return new PageUtils(page);
    }

}